From: kaf24@firebug.cl.cam.ac.uk Date: Sat, 24 Sep 2005 07:58:41 +0000 (+0100) Subject: Fix tpm split driver to follow changes in the xenbus API. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16770^2~1^2~4^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0a045970ea87458dad6fe7cebcb286f648ebec5c;p=xen.git Fix tpm split driver to follow changes in the xenbus API. Signed-off-by: Stefan Berger --- diff --git a/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c b/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c index 49c946aeec..3bb1247a00 100644 --- a/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c +++ b/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c @@ -93,7 +93,8 @@ static void frontend_changed(struct xenbus_watch *watch, const char *node) * Tell the front-end that we are ready to go - * unless something bad happens */ - err = xenbus_transaction_start(be->dev->nodename); +again: + err = xenbus_transaction_start(); if (err) { xenbus_dev_error(be->dev, err, "starting transaction"); return; @@ -127,7 +128,14 @@ static void frontend_changed(struct xenbus_watch *watch, const char *node) goto abort; } - xenbus_transaction_end(0); + err = xenbus_transaction_end(0); + if (err == EAGAIN) + goto again; + if (err) { + xenbus_dev_error(be->dev, err, "end of transaction"); + goto abort; + } + xenbus_dev_ok(be->dev); return; abort: diff --git a/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c b/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c index f19676d1db..a9535a08f4 100644 --- a/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c @@ -331,7 +331,8 @@ static int talk_to_backend(struct xenbus_device *dev, goto out; } - err = xenbus_transaction_start(dev->nodename); +again: + err = xenbus_transaction_start(); if (err) { xenbus_dev_error(dev, err, "starting transaction"); goto destroy_tpmring; @@ -363,6 +364,8 @@ static int talk_to_backend(struct xenbus_device *dev, } err = xenbus_transaction_end(0); + if (err == EAGAIN) + goto again; if (err) { xenbus_dev_error(dev, err, "completing transaction"); goto destroy_tpmring;